<template>
  <el-dialog :visible.sync="visible" :close-on-click-modal="false">
    <el-form ref="dataForm" :rules="rules" :model="dataFrom" label-position="right" label-width="80px" style="width: 500px; margin-left:50px;">
      <el-form-item label="投顾名称" prop="investName">
        <el-input v-model="dataFrom.investName" />
      </el-form-item>
      <el-form-item label="联系人" prop="investContacts">
        <el-input v-model="dataFrom.investContacts" />
      </el-form-item>
      <el-form-item label="手机号码" prop="investMobile">
        <el-input v-model="dataFrom.investMobile" />
      </el-form-item>
      <el-form-item label="微信号" prop="investWechat">
        <el-input v-model="dataFrom.investWechat" />
      </el-form-item>
      <el-form-item label="邮箱" prop="investEmail">
        <el-input v-model="dataFrom.investEmail" />
      </el-form-item>
      <el-form-item label="渠道来源" prop="investChannel">
        <el-input v-model="dataFrom.investChannel" />
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dialogStatus==='create'?addSubmit():updateSubmit()">提交</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      visible: false,
      dialogStatus: 'create',
      dataFrom: {},
      rules: {
        investName: [{ required: true, message: '投顾名称必填', trigger: 'blur' }],
        investMobile: [{ required: true, message: '手机号码必填', trigger: 'blur' }]
      }
    }
  },
  methods: {
    init(row) {
      this.visible = true
      this.$nextTick(() => {
        this.$refs['dataForm'].resetFields()
        if(row) {
          this.dataFrom.id = row.id
          this.dialogStatus = 'update'
          this.dataFrom.modelName = row.modelName
        }
      })
    },
    addSubmit() {},
    updateSubmit() {},
    getInfo() {}
  }
}
</script>

<style lang="scss" scoped>

</style>
